package com.metaera.app.ui.activities;

import android.graphics.drawable.Drawable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.metaera.app.R;
import com.metaera.app.controller.core.IPaginationPresenter;
import com.metaera.app.controller.presenter.NoticeListPresenter;
import com.metaera.app.controller.view.core.IPaginationView;
import com.metaera.app.data.model.NoticeListResponse;
import com.metaera.app.ui.adapters.NoticeListAdapter;
import com.metaera.app.ui.core.BaseRequestListActivity;

import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.RecyclerView;

public class NoticeListActivity extends BaseRequestListActivity<NoticeListResponse> {

    @Override
    protected String getActivityTitle() {
        return getString(R.string.meta_era_notice);
    }

    @Override
    protected BaseQuickAdapter<NoticeListResponse, BaseViewHolder> createAdapter(RecyclerView recyclerView) {
        DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
        Drawable drawable = ContextCompat.getDrawable(recyclerView.getContext(), R.drawable.shape_item_divider);
        dividerItemDecoration.setDrawable(drawable);
        recyclerView.addItemDecoration(dividerItemDecoration);
        return new NoticeListAdapter();
    }

    @Override
    protected IPaginationPresenter<IPaginationView<NoticeListResponse>, NoticeListResponse> createPresenter() {
        return new NoticeListPresenter();
    }

}
